﻿@model AerolineaApp.Models.Vuelo

@{
    ViewBag.Title = "Create";
    int hora = DateTime.Now.Hour;
    int minutos = DateTime.Now.Minute;
}
@{
   
if(null != TempData["Alert"]) {
    
    <script type="text/javascript">
    var i='@(TempData["Alert"])';
        alert(i);
</script>
}
}

   


<h2>Create</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="../../Scripts/jquery-ui-1.8.11.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-ui-1.8.11.min.js" type="text/javascript"></script>
<link href="../../Content/themes/base/jquery.ui.datepicker.css" rel="stylesheet" type="text/css" />
<link href="../../Content/themes/cupertino/jquery-ui.css" rel="stylesheet" type="text/css" />
<link href="../../Content/themes/cupertino/jquery.ui.theme.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
    $(document).ready(function () {
        $("#Fecha").datepicker({ dateFormat: 'dd/mm/yy'
                                        , buttonImage: '~/Content/Images/datepickerButton.jpg',
                                          buttonImageOnly: true
        });
    });
</script>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Vuelo</legend>
        <table id="tabla">
        <tr>
        <td>
        <div class="editor-label">
            @Html.LabelFor(model => model.Ciudad_Origen)
        </div>
        </td>
        <td>
        <div class="editor-field">
            @Html.DropDownList("Ciudad_Origen", String.Empty)
            @Html.ValidationMessageFor(model => model.Ciudad_Origen)
        </div>
        </td>
        </tr>
        <tr>
        <td>
        <div class="editor-label">
            @Html.LabelFor(model => model.Ciudad_Destino)
        </div>
        </td>
        <td>
        <div class="editor-field">
            @Html.DropDownList("Ciudad_Destino", String.Empty)
            @Html.ValidationMessageFor(model => model.Ciudad_Destino)
        </div>
        </td>
        </tr>
        <tr>
        <td>
        <div class="editor-label">
            @Html.LabelFor(model => model.Fecha)
        </div>
        </td>
        <td>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.Fecha)
            @Html.ValidationMessageFor(model => model.Fecha)
        </div>
        </td>
        </tr>
        <tr>
        <td>
        <div class="editor-label">
            @Html.LabelFor(model => model.Duracion)
        </div>
        </td>
        <td>
        <div class="editor-field">
            @Html.EditorFor(model => model.Duracion)
            @Html.ValidationMessageFor(model => model.Duracion)
        </div>
        </td>
        </tr>
        <tr>
        <td>
        <div class="editor-label">
            @Html.LabelFor(model => model.Asientos_Diponibles)
        </div>
        </td>
        <td>
        <div class="editor-field">
            @Html.EditorFor(model => model.Asientos_Diponibles)
            @Html.ValidationMessageFor(model => model.Asientos_Diponibles)
        </div>
        </td>
        </tr>
        <tr>
        <td>
        <div class="editor-label">
            @Html.LabelFor(model => model.Precio)
        </div>
        </td>
        <td>
        <div class="editor-field">
            @Html.EditorFor(model => model.Precio)
            @Html.ValidationMessageFor(model => model.Precio)
        </div>
        </td>
        </tr>
        <tr>
        <td>
        <div class="editor-label">
            @Html.LabelFor(model => model.AvionId, "Avion:")
        </div>
        </td>
        <td>
        <div class="editor-field">
            @Html.DropDownList("AvionId", String.Empty)
            @Html.ValidationMessageFor(model => model.AvionId)
        </div>
        </td>
        </tr>
        <tr>
        <td>
        <div class="editor-label">
            @Html.LabelFor(model => model.AerolineaId, "Aerolinea:")
        </div>
        </td>
        <td>
        <div class="editor-field">
            @Html.DropDownList("AerolineaId", String.Empty)
            @Html.ValidationMessageFor(model => model.AerolineaId)
        </div>
        </td>
        </tr>
        </table>
        <p>
            <input type="submit" value="Procesar" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
